package doudizhu;
/***********************************************************************
 * Module:  HandCards.java
 * Author:  Thinkpad
 * Purpose: Defines the Class HandCards
 ***********************************************************************/

import java.util.*;

/** @pdOid 90ba4382-4ce6-4ece-95a8-b34ec9e80a57 */
public class HandCards {
   /** @pdOid cba42db1-9f6e-44fb-8ef4-f7e1d7cf537b */
   private List<Card> handscards;
   
   /** @pdRoleInfo migr=no name=Card assc=association3 coll=java.util.Collection impl=java.util.HashSet mult=0..* type=Aggregation */
   public java.util.Collection card;
   
   
   /** @pdGenerated default getter */
   public java.util.Collection getCard() {
      if (card == null)
         card = new java.util.HashSet();
      return card;
   }
   
   /** @pdGenerated default iterator getter */
   public java.util.Iterator getIteratorCard() {
      if (card == null)
         card = new java.util.HashSet();
      return card.iterator();
   }
   
   /** @pdGenerated default setter
     * @param newCard */
   public void setCard(java.util.Collection newCard) {
      removeAllCard();
      for (java.util.Iterator iter = newCard.iterator(); iter.hasNext();)
         addCard((Card)iter.next());
   }
   
   /** @pdGenerated default add
     * @param newCard */
   public void addCard(Card newCard) {
      if (newCard == null)
         return;
      if (this.card == null)
         this.card = new java.util.HashSet();
      if (!this.card.contains(newCard))
         this.card.add(newCard);
   }
   
   /** @pdGenerated default remove
     * @param oldCard */
   public void removeCard(Card oldCard) {
      if (oldCard == null)
         return;
      if (this.card != null)
         if (this.card.contains(oldCard))
            this.card.remove(oldCard);
   }
   
   /** @pdGenerated default removeAll */
   public void removeAllCard() {
      if (card != null)
         card.clear();
   }

}